xen/arm: Rename grant_table_gfpn into grant_table_gfn and use the typesafe gfn
authorJulien Grall <julien.grall@arm.com>
Tue, 28 Jun 2016 16:17:09 +0000 (17:17 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 28 Jun 2016 18:19:36 +0000 (19:19 +0100)
The correct acronym for a guest physical frame is gfn. Also use
the typesafe gfn to ensure that a guest frame is effectively used.

Signed-off-by: Julien Grall <julien.grall@arm.com>
Acked-by: Stefano Stabellini <sstabellini@kernel.org>
xen/arch/arm/domain.c
xen/arch/arm/mm.c
xen/include/asm-arm/domain.h
xen/include/asm-arm/grant_table.h

index d8a804ca483faf5bbebd14971b74fd8b95d9acb9..6ce464589875e9eb51a6063a98d04f6ace8e8f1f 100644 (file)
@@ -464,13 +464,13 @@ struct domain *alloc_domain_struct(void)
         return NULL;
 
     clear_page(d);
-    d->arch.grant_table_gpfn = xzalloc_array(xen_pfn_t, max_grant_frames);
+    d->arch.grant_table_gfn = xzalloc_array(gfn_t, max_grant_frames);
     return d;
 }
 
 void free_domain_struct(struct domain *d)
 {
-    xfree(d->arch.grant_table_gpfn);
+    xfree(d->arch.grant_table_gfn);
     free_xenheap_page(d);
 }
 
index 6882d543bd3827e8eaadb4b120b7997ac7edf0d2..0e408f848051b34770fab79ae141525a37f2f93e 100644 (file)
@@ -1082,7 +1082,7 @@ int xenmem_add_to_physmap_one(
                 return -EINVAL;
         }
 
-        d->arch.grant_table_gpfn[idx] = gfn_x(gfn);
+        d->arch.grant_table_gfn[idx] = gfn;
 
         t = p2m_ram_rw;
 
index 370cdeb610338b26a4b909dbc68b6c2ed086e45b..979f7de21864fd9e85d045f8edb63e7188c7e7a6 100644 (file)
@@ -51,7 +51,7 @@ struct arch_domain
     uint64_t vttbr;
 
     struct hvm_domain hvm_domain;
-    xen_pfn_t *grant_table_gpfn;
+    gfn_t *grant_table_gfn;
 
     struct vmmio vmmio;
 
index 5e076ccac34623c8ddc349edbfc20e198bef0317..eb024230ba70f338818872945f947a66f68141df 100644 (file)
@@ -30,7 +30,7 @@ static inline int replace_grant_supported(void)
 
 #define gnttab_shared_gmfn(d, t, i)                                      \
     ( ((i >= nr_grant_frames(d->grant_table)) &&                         \
-     (i < max_grant_frames)) ? 0 : (d->arch.grant_table_gpfn[i]))
+     (i < max_grant_frames)) ? 0 : gfn_x(d->arch.grant_table_gfn[i]))
 
 #define gnttab_need_iommu_mapping(d)                    \
     (is_domain_direct_mapped(d) && need_iommu(d))